﻿using B.S.Data.MES.API.Applications.WorkOrderManagement.Commands;
using B.S.Domain.BasicData.Factory_modeling.Production_line_management;
using B.S.Infratrctrue;
using B.S.Requst;
using MediatR;

namespace B.S.Data.MES.API.Applications.WorkOrderManagement.CommandHandlers
{
    public class GetProduction_line_managementCommandHandler : IRequestHandler<GetProduction_line_managementCommand, APIRequst<List<Production_line_management>>>
    {
        private readonly IBaseRepository<Production_line_management> _Production_lineRepository;
        public GetProduction_line_managementCommandHandler(IBaseRepository<Production_line_management> Production_lineRepository)
        {
            _Production_lineRepository = Production_lineRepository;
        }
        public Task<APIRequst<List<Production_line_management>>> Handle(GetProduction_line_managementCommand request, CancellationToken cancellationToken)
        {
            var mentcode = _Production_lineRepository.GetAll();

            return Task.FromResult(new APIRequst<List<Production_line_management>> {
            
                Data=mentcode.ToList(),
                Code=RequstCode.成功,
                Msg=RequstCode.成功.ToString(),
            
            });
        }
    }
}
